using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace BeachRunner.BeachRunner
{
    /// <summary>
    /// Highscore
    /// 
    /// Autor: Arne Blumentritt
    /// </summary>
    [DataContract]
    public class Highscore : IComparable<Highscore>
    {
        [DataMember]
        public DateTime Time { get; set; }
        [DataMember]
        public int Score { get; set; }
        [DataMember]
        public Game1.Maps Map { get; set; }
        [DataMember]
        public bool isNew { get; set; }

        public Highscore(Game1.Maps map, DateTime time, int score)
        {
            this.Map = map;
            this.Time = time;
            this.Score = score;
            this.isNew = true;
        }

        public int CompareTo(Highscore other)
        {
            if (Score < other.Score)
                return 1;
            else if (Score == other.Score)
                return 0;
            else
                return -1;
        }
    }
}
